# coding:utf-8
import hashlib

def trim(string):
    """
    remove \n,space
    """
    string = string.replace("\n", '').replace(' ', '').replace("\r", '')
    return string


def md5(str):
    """
    只适用utf-8编码
    """
    hl = hashlib.md5()
    hl.update(str.encode(encoding='utf-8'))
    return hl.hexdigest()
